Integrating Equivalency Reasoning into Davis-Putnam Procedure

نویسنده

  • Chu Min Li
چکیده

Equivalency clauses (Xors or modulo 2 arithmetics) represent a common structure in the SAT-encoding of many hard real-world problems and constitute a major obstacle to DavisPutnam (DP) procedure. We propose a special look-ahead technique called equivalency reasoning to overcome the obstacle and report on the performance of an equivalency reasoning enhanced DP procedure on SAT instances containing equivalency clauses derived from problems in parity learning, cryptographic key search and model checking. Our results show that integrating equivalency reasoning renders easy many problems which were beyond DP’s reach. We also compare equivalency reasoning with general CSP look-back techniques on equivalency clauses. Introduction Consider a propositional formula F in Conjunctive Normal Form (CNF) on a set of Boolean variables fx1; x2; :::; xng. The satisfiability (SAT) problem consists in testing whether clauses in F can all be satisfied by some consistent assignment of truth values (1 or 0) to variables. SAT is fundamental in many fields of computer science, electrical engineering and mathematics. It was the first NP-Complete problem (Cook 1971). Let l with or without index be a literal. An equivalency clause of length k can be written as l1 $ l2 $ :::$ lk where the operator $ is commutative and associative. The equivalency clause is equivalent to 2k 1 CNF clauses. For example, a binary equivalency clause is equivalent to 2 CNF clauses: l1 _ l2 and l1 _ l2, and a ternary equivalency clause is equivalent to 4 CNF clauses: l1 _ l2 _ l3, l1 _ l2 _ l3, l1 _ l2 _ l3, and l1 _ l2 _ l3. When encoding a hard real-world problem as SAT, one usually structures the problem in layers and makes use of abbreviations and definitions, which often results in a number of equivalency clauses (in their equivalent CNF form) in Copyright c 2000, American Association for Artificial Intelligence (www.aaai.org). All rights reserved. the final SAT instance. Unfortunately, equivalency clauses of length > 2 generally are hard for Davis-Putnam procedure (DP) (Davis et al. 1962), the best systematic method for SAT. The reason for the inefficiency of DP procedure on these problems seems to be that equivalency clauses give very few unit clauses throughout the resolution while on other problems DP procedure often deals with many unit clauses under some depth. On the other hand, fixing a variable in equivalency clauses often produces a number of equivalent literals from which an equivalency reasoning can be made to remedy the ineffectiveness of unit propagation. In this paper we show how to integrate equivalency reasoning to solve problems containing both equivalency clauses (called EQ part) and other CNF clauses (called CNF part). The paper is organized as follows. In section 2 we define equivalency reasoning. In section 3 we present the equivalency reasoning enhanced DP procedure called EqSatz. Our approach was originally motivated by the second challenge problem formulated by Selman et al. (1997) at IJCAI’97. Section 4 reports on the performance of EqSatz on the challenge problem. In section 5 we report on and compare the performance of EqSatz with 4 state-of-the-art DPs on various SAT problems involving equivalency clauses. All experimental results are obtained on a Macintosh G3 300 Mhz with 96 Mb memory under Linux system and run time is expressed in seconds. Section 6 discusses related work and Section 7 concludes. Equivalency Reasoning An equivalency clause can be negated with the following property: :(l1 $ l2 $ :::$ lk) l1 $ l2 $ :::$ lk l1 $ l2 $ :::$ lk ::: l1 $ l2 $ :::$ lk (1) Since all equivalency clauses of length > 3 can be simply transformed into ternary equivalency clauses by adding new variables, we only consider binary (k = 2) and ternary (k = 3) equivalency clauses in this paper. We define six inference rules on them. l1; l1 $ l2 $ l3 ` l2 $ l3 (2) l1; l1 $ l2 $ l3 ` :(l2 $ l3) (3) l1 $ l1 $ l2 ` l2 (4) l1 $ l2 $ l3; l1 $ l2 $ l4 ` l3 $ l4 (5) l1 ! (l3 $ l4); l1 ! (l3 $ l4) ` l3 $ l4 (6) l1 ! (l3 $ l4); l1 ! ( l3 $ l4) ` l1 $ l3 $ l4 (7) Note that the right side of rule 3 can be rewritten as l2 $ l3 or l2 $ l3 using property 1. All these rules can be realized by a constant number of resolution steps after writing the equivalency clauses in CNF form. We call the application of these rules in a formula F equivalency reasoning. Binary equivalency clauses play a particular role in our approach. Every time a binary equivalency clause l1 $ l2 is deduced by rule 2, 3, 5, or 6, l1 is substituted by l2 in F . It can be shown that DIMACS1 dubois* problem is solved in linear time by repeatedly applying rule 5 and the equivalent literal substitution. Ternary equivalency clauses are represented both in CNF form and by a list of the three involved variables, eventually with a negation operator. For example the equivalency clause x $ y $ z is represented by four CNF clauses and by :(x; y; z). Rule 7 is used to add new ternary equivalency clauses into F . Given three equivalency clauses x $ u $ v, y $ u$ w, and z $ v $ w, one adds a unit clause x, rule 2 applied to the first equivalency clause gives u $ v. Then one substitutes u by v in the second equivalency clause before applying rule 5 to obtain y $ z. So x ! (y $ z). Similarly x ! ( y $ z). Applying rule 7, one obtains x$ y $ z, an equivalency clause to be added into F . Rule 6 is also used in this way to deduce new equivalent literals. It can be shown from its own construction that DIMACS pret* problem, although hard for a classical implementation of DP procedure, is solved in linear time by repeatedly adding new ternary equivalency clauses into F . EqSatz: An Equivalency Reasoning Enhanced DP We implement the six inference rules defined in section 2 into a highly optimized DP procedure called Satz (Li and Anbulagan 1997). Satz consists of a fast unit propagator and a powerful look-ahead heuristic based on unit propagation to select the next branching variable to maximize the reduction of search space when branching. Equivalency reasoning enhanced Satz is called EqSatz and is sketched in Figure 1. Figure 2 shows the implementation of equivalency reasoning. Figure 3 shows the branching rule of EqSatz. ftp://dimacs.rutgers.edu/pub/challenge/sat The equivalency clauses contained in the input formula are in CNF form. Rules 2 and 3 are performed by unit propagation, so equivalency reasoning begins by detecting equivalent literals produced by unit propagation. If l1 is equivalent to l2, it is substituted by l2. Note that the substitution may produce a unit clause in case l1 _ l2 is a clause in F . Property 1 is used to rewrite equivalency clauses in an appropriate form to apply the inference rules. Equivalency reasoning is naturally integrated in the heuristic of Satz. Given a free variable x, Satz examines x by respectively adding two unit clauses x and x into F and makes two experimental unit propagations to see the impact of branching on x. Following this line, EqSatz performs an experimental equivalency reasoning after each experimental unit propagation to look further forward and to add new equivalency clauses into F using rules 6 and 7. Like Satz, EqSatz tries to branch to the variable allowing to maximize the reduction of search space by taking equivalency reasoning into account and uses three functions to estimate the reduction of search space. Procedure EqSatz(F) Begin if F is empty, return "satisfiable"; F:=UnitPropagation(F); F:=Equivalency Reasoning(F); if F contains an empty clause, return "unsatisfiable". /* branching rule */ select a variable x in F. If EqSatz(F [ fxg) is "satisfiable" then return "satisfiable", otherwise return the result of EqSatz(F [ f xg). End. procedure UnitPropagation(F) Begin While there is no empty clause and a unit clause l exists, satisfy l and simplify F. Return F. End. Figure 1: The DP Procedure EqSatz The first function is nb fixed vars(F1;F2) giving the number of variables of F2 instantiated in F1, and the second is nb eq pairs(F1;F2) giving the number of equivalent literals of F2 substituted in F1. The motivation is that the instantiation of a variable or a new deduced literal equivalence such as l3 $ l4 cuts the search space in half. The third function nb binary lauses(F1;F2) (nb bin ls(F1;F2) in short) is defined following the same line. But the consideration is somewhat more complicated. If F has n variables, it has 2n possible solutions. A binary clause removes 2n 2 solutions. But generally two binary clauses together do not remove 2n 1 solutions. In fact two binary clauses sharing an identical literal or having no common variable such as x1_x2 and x1_x3 or x1_x2 and x3 _ x4 remove 2n 1 2n 3 and 2n 1 2n 4 solutions, respectively. Only two binary clauses sharing a complementary literal such as x1 _ x2 and x1 _ x3 remove 2n 1 solutions. Clearly binary clauses sharing complementary literals remove many more solutions and have more chances to lead to a dead-end where all solutions are removed. So a DP procedure should branch next on the variable generating subproblems having more binary clauses sharing complementary literals. nb bin ls(F1;F2) = X l_l0 is in F1 but not in F2[f( l)+f( l0)℄ where f( l) is the number of binary occurrences of l in F2. Procedure Equivalency Reasoning(F) Begin F:=Set Equivalence by CNF Clauses(F); repeat /* Rule 4 */ while there is an equivalency clause containing two identical literals such as l1 $ l1 $ l3 but no empty clause do begin satisfy l3 and simplify F; F:=Set Equivalence by CNF Clauses(F); end; /* Rule 5 */ while there are two equivalency clauses containing two identical literals such as l1 $ l2 $ l3 and l1 $ l2 $ l4 but no empty clause do if l3 = :l4 then add an empty clause into F else begin F:=Substitute(l3, l4, F); F:=Set Equivalence by CNF Clauses(F); end until an empty clause is produced or no change happens in F End. procedure Set Equivalence by CNF Clauses(F) Begin while F contains two binary CNF clauses such as l1 _ l2 and l1 _ l2 but no empty clause do F:=Substitute(l1, l2, F); return F End. procedure Substitute(l1, l2, F) Begin substitute all occurrences of l1( l1) by l2( l2); F:=UnitPropagation(F); return F; End. Figure 2: The Procedure Equivalency Reasoning Solving the Challenge DIMACS 32-bit Parity Problem EqSatz was originally motivated by the challenge DIMACS 32-bit parity problem formulated by Selman et al. (1997) at IJCAI’97. To the best of our knowledge, EqSatz is the only procedure which is able to solve all the ten par32* instances in reasonable time. Table 1 shows the performance of EqSatz on the challenge problem. As in the next section, #cls and #eq cls2 respectively denote the total number of clauses in the input CNF formula and the number of ternary equivalency clauses, a ternary equivalency clause being counted as 4 clauses in #cls. As can be seen, All instances contain a large EQ part. Equivalency reasoning makesEqSatz substantially faster than Satz on the challenge parity problem. In the next section we show that it is sufficiently powerful to make a DP procedure able to solve other problems. For each free variable x do let F 0 and F 00 be two copies of F Begin F 0 := UnitPropagation(F 0 [ fxg); F 00 := UnitPropagation(F 00 [ f xg); F 0:=Equivalency Reasoning(F 0); F 00:=Equivalency Reasoning(F 00); If both F 0 and F 00 contain an empty clause then return "F is unsatisfiable". else if F 0 contains an empty clause then x := 0, F := F 00 else if F 00 contains an empty clause then x := 1, F := F 0; else begin /* Rule 6 */ for all l3 $ l4 2 F 0 ^ F 00 F:=Substitute(l3,l4,F); /* Rule 7 */ for all l3 $ l4 2 F 0 and l3 $ l4 2 F 00 add x$ l3 $ l4 into F. F:=Equivalency Reasoning(F); if F contains an empty clause then return "F is unsatisfiable". let w(l) denote the weight of literal l, w(x) := nb fixed vars(F 0;F) + nb eq pairs(F 0;F) +nb bin ls(F 0;F)=2 w( x) := nb fixed vars(F 00;F) + nb eq pairs(F 00;F) +nb bin ls(F 00;F)=2; end End; For each free variable x do H(x) := w( x) w(x) 1024 + w( x) + w(x); Branching on the free variable x such that H(x) is the greatest. Figure 3: The Branching Rule of EqSatz 2EqSatz inherits from Satz a preprocessing of the input instance searching and adding resolvents of length 3, which may remove some equivalency clauses. #eq cls denotes the number of remaining ternary equivalency clauses. Table 1: Run time and search tree size (t size) of EqSatz on the challenge DIMACS 32-bit parity problem Instance #var #cls #eq cls time t size par32-1-c 1315 5254 1097 1133 3672 par32-2-c 1303 5206 1085 50 209 par32-3-c 1325 5294 1107 3972 15123 par32-4-c 1333 5326 1115 793 1488 par32-5-c 1339 535

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

The Complexity of Automated Reasoning

This thesis explores the relative complexity of proofs produced by the automatic theorem proving procedures of analytic tableaux, linear resolution, the connection method, tree resolution and the Davis-Putnam procedure. It is shown that tree resolution simulates the improved tableau procedure and that SL-resolution and the connection method are equivalent to restrictions of the improved tableau...

متن کامل

Theoretical Analysis of Davis-Putnam Procedure and Propositional Satisfiability

This paper presents a statistical analysis of the Davis-Putnam procedure and propositional satisfiability problems (SAT). SAT has been researched in AI because of its strong relationship to automated reasoning and recently it is used as a benchmark problem of constraint satisfaction algorithms. The Davis-Putnam procedure is a wellknown satisfiability checking algorithm based on tree search tech...

متن کامل

An Algorithm to Evaluate Quanti ed BooleanFormulae and its Experimental Evaluation

The high computational complexity of advanced reasoning tasks such as reasoning about knowledge and planning calls for eecient and reliable algorithms for reasoning problems harder than NP. In this paper we propose Evaluate, an algorithm for evaluating Quantiied Boolean Formulae (QBFs). Algorithms for evaluation of QBFs are suitable for the experimental analysis on problems that belong to a wid...

متن کامل

Constraint - Based Reasoning and Constraint Programming 182

We show the equivalence between the so-called DavisPutnam procedure [3, 2] and the Forward Checking of Haralick and Elliot [7]. Both apply the paradigm choose and propagate in two different formalisms, namely the propositional calculus and the constraint satisfaction problems formalism. They happen to be strictly equivalent as soon as a compatible instantiation order is chosen. This equivalence...

متن کامل

A New Met

We introduce a greedy local search procedure called GSAT for solving propositional satisfiability problems. Our experiments show that this procedure can be used to solve hard, randomly generated problems that are an order of magnitude larger than those that can be handled by more traditional approaches such as the Davis-Putnam procedure or resolution. We also show that GSAT can solve structured...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2000